<template>
 <div>
     <el-form label-width="80px">
         <el-form-item label="test">
             <el-button type="primary" :loading="loading" @click="test()">test</el-button>
         </el-form-item>
     </el-form>
 </div>
</template>

<script>
 export default {
     name:'test',
     data(){
         return {
             loading :false
         }
     },
     methods:{
         test(){
             this.loading = true;
             //调用store中action
             this.$store.dispatch('Test',this.loginRuleForm).then(()=>{
                 this.loading = false;
                 // this.$router.push({path: '/'})
             }).catch(()=>{
                 this.loading = false;
             })
         }
     }
 }
</script>

<style>

</style>